package com.kfm.pm;

import java.util.Arrays;

public class Demo07 {

    public static void main(String[] args) {
        // 二分查找
        int[] arr = {1, 2, 4, 6, 7, 9, 10, 29, 30, 34, 56};
        int key = 31;
        int index = Arrays.binarySearch(arr, key);
        System.out.println(index);
    }
}
